import 'package:number_spark_flutter/config/ns_global_config.dart';
import 'package:number_spark_flutter/widgets/brick/ns_brick.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../style/ns_style.dart';

class NSLoginAgreementDialog extends StatelessWidget {
  const NSLoginAgreementDialog({super.key, required this.doClickAgree});

  final Function() doClickAgree;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.transparent,
      body: Center(
        child: Wrap(
          children: [
            NSColumn(
              padding: EdgeInsets.symmetric(vertical: 24.h),
              width: double.maxFinite,
              radius: 12.w,
              margin: EdgeInsets.symmetric(horizontal: 30.w),
              color: Colors.white,
              children: [
                NSImage(
                  assetImage: 'icon_app_logo.png',
                  width: 52.w,
                  height: 52.w,
                  radius: 12.w,
                ),
                NSText(text: NSGlobalConfig.packageInfo.appName, fontSize: 20.sp, textColor: Colors.black, margin: EdgeInsets.only(top: 12.h), fontFamily: 'Modak-Regular'),
                NSText(
                    margin: EdgeInsets.only(top: 14.h, left: 24.w, right: 24.w),
                    maxLines: 2,
                    shrinkWrap: false,
                    text: 'By using our App you agree with our  Term of Use  and Privacy Policy.',
                    textColor: Colors.black,
                    fontSize: 14.sp,
                    fontWeight: FontWeight.normal,
                    fontFamily: 'Modak-Regular'),
                NSImage(
                  margin: EdgeInsets.only(top: 12.w),
                  assetImage: 'img_bg_agree_btn.png',
                  width: 180.w,
                  onTap: doClickAgree,
                ),
                NSText(
                  alignment: Alignment.center,
                  width: 180.w,
                  height: 40.w,
                  radius: 20.w,
                  color: kAppColor('#F4F4F4'),
                  margin: EdgeInsets.only(top: 16.h),
                  text: 'Cancel',
                  foreground: Paint()
                    ..style = PaintingStyle.stroke
                    ..strokeWidth = 1
                    ..color = kAppColor('#A75011'),
                  // 描边颜色,
                  fontSize: 12.sp,
                  fontFamily: 'Modak-Regular',
                  onTap: () {
                    Get.back();
                  },
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}
